/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaInicial.java
 *
 * Created on 03/12/2011, 12:30:15
 */
package br.uff.ihc.gui;

import br.uff.ihc.bd.tabelas.TB_Paciente;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.Toolkit;
import java.util.Locale;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.LineBorder;

/**
 *
 * @author Adrielle
 */
public class TelaConsultas extends javax.swing.JFrame {

    /** Creates new form TelaInicial */
    private TB_Paciente tabela;
    public TelaConsultas(String nome) {
        initComponents();
        Insets in = Toolkit.getDefaultToolkit().getScreenInsets(this.getGraphicsConfiguration());
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
        int width = d.width - (in.left + in.top);
        int height = d.height - (in.top + in.bottom);
        setSize(width, height);
        setLocation(in.left, in.top);
        setExtendedState(TelaConsultas.MAXIMIZED_BOTH);
        pnBTBuscarConsulta.setBackground(new Color(0, 51, 0));
        pnBuscarConsulta.setBackground(new Color(0, 51, 0));
        pnBTNovaConsulta.setBackground(Color.WHITE);
        pnBTNovaConsulta.getComponent(0).setForeground(Color.BLACK);
        pnBTBuscarConsulta.getComponent(0).setForeground(Color.WHITE);
        pnBuscarConsulta.getComponent(0).setForeground(Color.WHITE);
        pnBTNovaConsulta.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 0, Color.BLACK));
        pnNovaConsulta.setVisible(true);
        pnAgenda.setVisible(false);
        pnBuscarConsulta.setVisible(false);

        lbNomeUsuario.setText(nome);
//
//        try {
//            for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (UnsupportedLookAndFeelException e) {
//        } catch (ClassNotFoundException e) {
//            // handle exception
//        } catch (InstantiationException e) {
//            // handle exception
//        } catch (IllegalAccessException e) {
//            // handle exception
//        }



    }

    public void centralizarComponente(Component pai, Component filho) {
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel5 = new javax.swing.JPanel();
        lbRotuloUsuario = new javax.swing.JLabel();
        lbNomeUsuario = new javax.swing.JLabel();
        lbData = new javax.swing.JLabel();
        pnPrincipal = new javax.swing.JPanel();
        pnBTBuscarConsulta = new javax.swing.JPanel();
        lbBuscarPaciente = new javax.swing.JLabel();
        pnBTAgenda = new javax.swing.JPanel();
        lbNonoPaciente = new javax.swing.JLabel();
        pnAgenda = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        lbMédicos = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jPanel8 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        pnBTNovaConsulta = new javax.swing.JPanel();
        lbNonoPaciente1 = new javax.swing.JLabel();
        pnNovaConsulta = new javax.swing.JPanel();
        lbCPF = new javax.swing.JLabel();
        lbNome = new javax.swing.JLabel();
        lbCSC = new javax.swing.JLabel();
        txNome = new javax.swing.JTextField();
        txCSC = new javax.swing.JTextField();
        txCPF = new javax.swing.JTextField();
        btSalvar = new javax.swing.JButton();
        lbMedico = new javax.swing.JLabel();
        lbDataConsulta = new javax.swing.JLabel();
        lbHora = new javax.swing.JLabel();
        cdMedico = new javax.swing.JComboBox();
        dtDataConsulta = new com.toedter.calendar.JDateChooser();
        cbHoraDisponivel = new javax.swing.JComboBox();
        lbNumeroConsulta = new javax.swing.JLabel();
        txNumeroConsulta = new javax.swing.JTextField();
        lbconsulta = new javax.swing.JLabel();
        btSalvar1 = new javax.swing.JButton();
        pnBuscarConsulta = new javax.swing.JPanel();
        lbDadosPessoais2 = new javax.swing.JLabel();
        txNome2 = new javax.swing.JTextField();
        lbNome2 = new javax.swing.JLabel();
        txCSC2 = new javax.swing.JTextField();
        lbCSC2 = new javax.swing.JLabel();
        lbDataNascimento2 = new javax.swing.JLabel();
        dtDataNascimento2 = new com.toedter.calendar.JDateChooser();
        lbMedico2 = new javax.swing.JLabel();
        lbEspecialidade2 = new javax.swing.JLabel();
        lbDataConsulta2 = new javax.swing.JLabel();
        lbHora2 = new javax.swing.JLabel();
        cbEspecialidade2 = new javax.swing.JComboBox();
        cdMedico2 = new javax.swing.JComboBox();
        dtDataConsulta2 = new com.toedter.calendar.JDateChooser();
        cbHoraDisponivel2 = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel5.setBackground(new java.awt.Color(47, 120, 47));

        lbRotuloUsuario.setFont(new java.awt.Font("Lucida Sans Typewriter", 1, 13));
        lbRotuloUsuario.setForeground(new java.awt.Color(255, 255, 255));
        lbRotuloUsuario.setText("Usuário:");

        lbNomeUsuario.setFont(new java.awt.Font("Lucida Sans Typewriter", 0, 13));
        lbNomeUsuario.setForeground(new java.awt.Color(255, 255, 255));
        lbNomeUsuario.setText("João Victor");

        lbData.setFont(new java.awt.Font("Lucida Sans Typewriter", 0, 13));
        lbData.setForeground(new java.awt.Color(255, 255, 255));
        lbData.setText("Quarta, 7 de dezembro de 2011 10:30h");

        pnPrincipal.setBackground(new java.awt.Color(255, 255, 255));
        pnPrincipal.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 51, 0), 1, true));
        pnPrincipal.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        pnBTBuscarConsulta.setBackground(new java.awt.Color(0, 51, 0));
        pnBTBuscarConsulta.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
        pnBTBuscarConsulta.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                OnBuscarConsulta(evt);
            }
        });

        lbBuscarPaciente.setFont(new java.awt.Font("Papyrus", 1, 14));
        lbBuscarPaciente.setForeground(new java.awt.Color(255, 255, 255));
        lbBuscarPaciente.setText("Buscar Consulta");

        javax.swing.GroupLayout pnBTBuscarConsultaLayout = new javax.swing.GroupLayout(pnBTBuscarConsulta);
        pnBTBuscarConsulta.setLayout(pnBTBuscarConsultaLayout);
        pnBTBuscarConsultaLayout.setHorizontalGroup(
            pnBTBuscarConsultaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnBTBuscarConsultaLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(lbBuscarPaciente)
                .addContainerGap())
        );
        pnBTBuscarConsultaLayout.setVerticalGroup(
            pnBTBuscarConsultaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnBTBuscarConsultaLayout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addComponent(lbBuscarPaciente, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE)
                .addContainerGap())
        );

        pnPrincipal.add(pnBTBuscarConsulta, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, 140, 40));

        pnBTAgenda.setBackground(new java.awt.Color(0, 51, 0));
        pnBTAgenda.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
        pnBTAgenda.setPreferredSize(new java.awt.Dimension(146, 47));
        pnBTAgenda.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                OnAgenda(evt);
            }
        });

        lbNonoPaciente.setFont(new java.awt.Font("Papyrus", 1, 14));
        lbNonoPaciente.setForeground(new java.awt.Color(255, 255, 255));
        lbNonoPaciente.setText("Agenda");

        javax.swing.GroupLayout pnBTAgendaLayout = new javax.swing.GroupLayout(pnBTAgenda);
        pnBTAgenda.setLayout(pnBTAgendaLayout);
        pnBTAgendaLayout.setHorizontalGroup(
            pnBTAgendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnBTAgendaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbNonoPaciente, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnBTAgendaLayout.setVerticalGroup(
            pnBTAgendaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnBTAgendaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbNonoPaciente)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pnPrincipal.add(pnBTAgenda, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, 140, 40));

        pnAgenda.setBackground(new java.awt.Color(255, 255, 255));
        pnAgenda.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 51, 0), 1, true));
        pnAgenda.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jTable1.setFont(new java.awt.Font("DejaVu Sans", 0, 12));
        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Paciente", "Data", "Hora", "Confirmado"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, true
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTable1);

        pnAgenda.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 60, 820, -1));

        lbMédicos.setBackground(new java.awt.Color(255, 0, 204));
        lbMédicos.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbMédicos.setText("Médicos");
        pnAgenda.add(lbMédicos, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, 160, 40));

        jScrollPane2.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 102, 0), 2, true));

        jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel3.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 2, true));

        jLabel2.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel2.setText("Dra. Amanda");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jLabel2)
                .addContainerGap(63, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, 40));

        jPanel2.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 2, true));

        jLabel1.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel1.setText("Dra. Bruna");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jLabel1)
                .addContainerGap(78, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 33, 180, 50));

        jPanel4.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 2, true));

        jLabel3.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel3.setText("Dr. Matheus");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jLabel3)
                .addContainerGap(67, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 80, -1, -1));

        jPanel6.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 2, true));

        jLabel4.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel4.setText("Dr. Pedro");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jLabel4)
                .addContainerGap(86, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 120, -1, -1));

        jPanel7.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 2, true));

        jLabel5.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel5.setText("Dra. Rafaela");

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jLabel5)
                .addContainerGap(69, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 160, -1, -1));

        jPanel8.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 2, true));

        jLabel6.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel6.setText("Dr. Sandro");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jLabel6)
                .addContainerGap(78, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 200, -1, -1));

        jPanel9.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 2, true));

        jLabel7.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel7.setText("Dr. Ronaldo");

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jLabel7)
                .addContainerGap(70, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 240, -1, -1));

        jScrollPane2.setViewportView(jPanel1);

        pnAgenda.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 60, 180, 410));

        pnPrincipal.add(pnAgenda, new org.netbeans.lib.awtextra.AbsoluteConstraints(149, 60, 1180, 570));

        pnBTNovaConsulta.setBackground(new java.awt.Color(0, 51, 0));
        pnBTNovaConsulta.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
        pnBTNovaConsulta.setPreferredSize(new java.awt.Dimension(146, 47));
        pnBTNovaConsulta.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                OnNovaConsulta(evt);
            }
        });

        lbNonoPaciente1.setFont(new java.awt.Font("Papyrus", 1, 14));
        lbNonoPaciente1.setForeground(new java.awt.Color(255, 255, 255));
        lbNonoPaciente1.setText("Nova Consulta");

        javax.swing.GroupLayout pnBTNovaConsultaLayout = new javax.swing.GroupLayout(pnBTNovaConsulta);
        pnBTNovaConsulta.setLayout(pnBTNovaConsultaLayout);
        pnBTNovaConsultaLayout.setHorizontalGroup(
            pnBTNovaConsultaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnBTNovaConsultaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbNonoPaciente1)
                .addContainerGap(19, Short.MAX_VALUE))
        );
        pnBTNovaConsultaLayout.setVerticalGroup(
            pnBTNovaConsultaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnBTNovaConsultaLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(lbNonoPaciente1)
                .addContainerGap())
        );

        pnPrincipal.add(pnBTNovaConsulta, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, 140, 40));

        pnNovaConsulta.setBackground(new java.awt.Color(255, 255, 255));
        pnNovaConsulta.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 51, 0), 1, true));
        pnNovaConsulta.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        lbCPF.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbCPF.setText("CPF:");
        pnNovaConsulta.add(lbCPF, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 170, 60, -1));

        lbNome.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbNome.setText("Nome:");
        pnNovaConsulta.add(lbNome, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 130, 60, -1));

        lbCSC.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbCSC.setText("Cartão de Saúde do Cidadão:");
        pnNovaConsulta.add(lbCSC, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 80, 258, -1));
        pnNovaConsulta.add(txNome, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 130, 580, -1));
        pnNovaConsulta.add(txCSC, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 80, 220, -1));
        pnNovaConsulta.add(txCPF, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 170, 210, -1));

        btSalvar.setFont(new java.awt.Font("DejaVu Sans", 0, 13));
        btSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/uff/ihc/gui/imagens/buscar.png"))); // NOI18N
        btSalvar.setText("Buscar");
        btSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSalvarActionPerformed(evt);
            }
        });
        pnNovaConsulta.add(btSalvar, new org.netbeans.lib.awtextra.AbsoluteConstraints(660, 70, 120, 40));

        lbMedico.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbMedico.setText("Médico(a):");
        pnNovaConsulta.add(lbMedico, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 260, -1, -1));

        lbDataConsulta.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbDataConsulta.setText("Data da Consulta:");
        pnNovaConsulta.add(lbDataConsulta, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 300, -1, -1));

        lbHora.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbHora.setText("Hora:");
        pnNovaConsulta.add(lbHora, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 340, -1, -1));

        cdMedico.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        cdMedico.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Dra. Amanda", "Dra. Bruna", "Dr. Matheus", "Dr. Pedro", "Dra. Rafaela", "Dr.Sandro", "Dr. Ronaldo" }));
        pnNovaConsulta.add(cdMedico, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 260, 340, -1));
        pnNovaConsulta.add(dtDataConsulta, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 300, 150, -1));

        cbHoraDisponivel.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        cbHoraDisponivel.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "08:00", "08:30", "10:00", "12:30", "13:00", "15:30", "17:00" }));
        pnNovaConsulta.add(cbHoraDisponivel, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 340, 130, -1));

        lbNumeroConsulta.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbNumeroConsulta.setText("Número da Consulta:");
        pnNovaConsulta.add(lbNumeroConsulta, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 220, -1, -1));

        txNumeroConsulta.setEnabled(false);
        pnNovaConsulta.add(txNumeroConsulta, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 220, 130, -1));

        lbconsulta.setFont(new java.awt.Font("Papyrus", 0, 11));
        lbconsulta.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Nova Consulta", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Papyrus", 0, 11), new java.awt.Color(0, 51, 0))); // NOI18N
        pnNovaConsulta.add(lbconsulta, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 30, 750, 360));

        btSalvar1.setFont(new java.awt.Font("DejaVu Sans", 0, 13));
        btSalvar1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/uff/ihc/gui/imagens/salvar.png"))); // NOI18N
        btSalvar1.setText("Salvar");
        pnNovaConsulta.add(btSalvar1, new org.netbeans.lib.awtextra.AbsoluteConstraints(730, 390, 110, 40));

        pnPrincipal.add(pnNovaConsulta, new org.netbeans.lib.awtextra.AbsoluteConstraints(149, 60, 1180, 570));

        pnBuscarConsulta.setBackground(new java.awt.Color(255, 255, 255));
        pnBuscarConsulta.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 51, 0), 1, true));
        pnBuscarConsulta.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        lbDadosPessoais2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Dados da Consulta", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Papyrus", 0, 11), new java.awt.Color(0, 51, 0))); // NOI18N
        pnBuscarConsulta.add(lbDadosPessoais2, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 20, 750, 340));
        pnBuscarConsulta.add(txNome2, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 70, 580, -1));

        lbNome2.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbNome2.setText("Nome:");
        pnBuscarConsulta.add(lbNome2, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 70, 60, -1));
        pnBuscarConsulta.add(txCSC2, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 150, 220, -1));

        lbCSC2.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbCSC2.setText("Cartão de Saúde do Cidadão:");
        pnBuscarConsulta.add(lbCSC2, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 150, 258, -1));

        lbDataNascimento2.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbDataNascimento2.setText("Data de Nascimento:");
        pnBuscarConsulta.add(lbDataNascimento2, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 110, 170, -1));
        pnBuscarConsulta.add(dtDataNascimento2, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 110, 130, -1));

        lbMedico2.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbMedico2.setText("Médico(a):");
        pnBuscarConsulta.add(lbMedico2, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 230, -1, -1));

        lbEspecialidade2.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbEspecialidade2.setText("Especialidade do Médico:");
        pnBuscarConsulta.add(lbEspecialidade2, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 190, -1, -1));

        lbDataConsulta2.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbDataConsulta2.setText("Data da Consulta:");
        pnBuscarConsulta.add(lbDataConsulta2, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 270, -1, -1));

        lbHora2.setFont(new java.awt.Font("Papyrus", 1, 16));
        lbHora2.setText("Hora:");
        pnBuscarConsulta.add(lbHora2, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 310, -1, -1));

        cbEspecialidade2.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        cbEspecialidade2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Neurologista" }));
        pnBuscarConsulta.add(cbEspecialidade2, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 190, 230, -1));

        cdMedico2.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        cdMedico2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Dra. Amanda", "Dra. Bruna", "Dr. Matheus", "Dr. Pedro", "Dra. Rafaela", "Dr.Sandro", "Dr. Ronaldo" }));
        pnBuscarConsulta.add(cdMedico2, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 230, 340, -1));
        pnBuscarConsulta.add(dtDataConsulta2, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 270, 110, -1));

        cbHoraDisponivel2.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        cbHoraDisponivel2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "13:00" }));
        pnBuscarConsulta.add(cbHoraDisponivel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 310, 130, -1));

        jButton1.setFont(new java.awt.Font("DejaVu Sans", 0, 13));
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/uff/ihc/gui/imagens/buscar.png"))); // NOI18N
        jButton1.setText("Buscar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        pnBuscarConsulta.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(820, 380, 120, 40));

        pnPrincipal.add(pnBuscarConsulta, new org.netbeans.lib.awtextra.AbsoluteConstraints(149, 60, 1180, 570));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbRotuloUsuario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbNomeUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 731, Short.MAX_VALUE)
                .addComponent(lbData, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addComponent(pnPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 1451, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(32, Short.MAX_VALUE)
                .addComponent(pnPrincipal, javax.swing.GroupLayout.PREFERRED_SIZE, 639, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbRotuloUsuario)
                    .addComponent(lbNomeUsuario)
                    .addComponent(lbData))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void OnAgenda(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_OnAgenda
        pnBTBuscarConsulta.setBackground(new Color(0, 51, 0));
        pnBTNovaConsulta.setBackground(new Color(0, 51, 0));
        pnBTAgenda.setBackground(Color.WHITE);

        pnBTAgenda.getComponent(0).setForeground(Color.BLACK);
        pnBTBuscarConsulta.getComponent(0).setForeground(Color.WHITE);
        pnBTNovaConsulta.getComponent(0).setForeground(Color.WHITE);

        pnBTAgenda.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 0, Color.BLACK));
        
        pnAgenda.setVisible(true);
        pnNovaConsulta.setVisible(false);
        pnBuscarConsulta.setVisible(false);
     
    }//GEN-LAST:event_OnAgenda

    private void OnBuscarConsulta(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_OnBuscarConsulta
        pnBTAgenda.setBackground(new Color(0, 51, 0));
        pnBTNovaConsulta.setBackground(new Color(0, 51, 0));
        pnBTBuscarConsulta.setBackground(Color.WHITE);
        pnBuscarConsulta.setBackground(Color.WHITE);

        pnBTBuscarConsulta.getComponent(0).setForeground(Color.BLACK);
        pnBTAgenda.getComponent(0).setForeground(Color.WHITE);
        pnBTNovaConsulta.getComponent(0).setForeground(Color.WHITE);

        pnBTBuscarConsulta.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 0, Color.BLACK));

        pnBuscarConsulta.setVisible(true);
        pnNovaConsulta.setVisible(false);
        pnAgenda.setVisible(false);
       // setDadosPessoaisVisiveis(false);

    }//GEN-LAST:event_OnBuscarConsulta

    private void OnNovaConsulta(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_OnNovaConsulta
        pnBTBuscarConsulta.setBackground(new Color(0, 51, 0));
        pnBTAgenda.setBackground(new Color(0, 51, 0));
        pnBTNovaConsulta.setBackground(Color.WHITE);

        pnBTNovaConsulta.getComponent(0).setForeground(Color.BLACK);
        pnBTBuscarConsulta.getComponent(0).setForeground(Color.WHITE);
        pnBTAgenda.getComponent(0).setForeground(Color.WHITE);

        pnBTNovaConsulta.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 0, Color.BLACK));

        pnNovaConsulta.setVisible(true);
        pnAgenda.setVisible(false);
        pnBuscarConsulta.setVisible(false);
    }//GEN-LAST:event_OnNovaConsulta

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        new ResultadoConsultaConsultas(lbNomeUsuario.getText()).setVisible(true);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
   
    for (int i=0;i<getTabela().getListaPacientes().size();i++){
         if(getTabela().getListaPacientes().get(i).getNumeroCartaoSaude().equals(txCSC.getText())){
             txNome.setText(getTabela().getListaPacientes().get(i).getNome());
             txCPF.setText(getTabela().getListaPacientes().get(i).getCpf());

             break;
         }
      }
    }//GEN-LAST:event_btSalvarActionPerformed




    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {

                TelaConsultas tela = new TelaConsultas("");
                tela.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btSalvar;
    private javax.swing.JButton btSalvar1;
    private javax.swing.JComboBox cbEspecialidade2;
    private javax.swing.JComboBox cbHoraDisponivel;
    private javax.swing.JComboBox cbHoraDisponivel2;
    private javax.swing.JComboBox cdMedico;
    private javax.swing.JComboBox cdMedico2;
    private com.toedter.calendar.JDateChooser dtDataConsulta;
    private com.toedter.calendar.JDateChooser dtDataConsulta2;
    private com.toedter.calendar.JDateChooser dtDataNascimento2;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable jTable1;
    private javax.swing.JLabel lbBuscarPaciente;
    private javax.swing.JLabel lbCPF;
    private javax.swing.JLabel lbCSC;
    private javax.swing.JLabel lbCSC2;
    private javax.swing.JLabel lbDadosPessoais2;
    private javax.swing.JLabel lbData;
    private javax.swing.JLabel lbDataConsulta;
    private javax.swing.JLabel lbDataConsulta2;
    private javax.swing.JLabel lbDataNascimento2;
    private javax.swing.JLabel lbEspecialidade2;
    private javax.swing.JLabel lbHora;
    private javax.swing.JLabel lbHora2;
    private javax.swing.JLabel lbMedico;
    private javax.swing.JLabel lbMedico2;
    private javax.swing.JLabel lbMédicos;
    private javax.swing.JLabel lbNome;
    private javax.swing.JLabel lbNome2;
    private javax.swing.JLabel lbNomeUsuario;
    private javax.swing.JLabel lbNonoPaciente;
    private javax.swing.JLabel lbNonoPaciente1;
    private javax.swing.JLabel lbNumeroConsulta;
    private javax.swing.JLabel lbRotuloUsuario;
    private javax.swing.JLabel lbconsulta;
    private javax.swing.JPanel pnAgenda;
    private javax.swing.JPanel pnBTAgenda;
    private javax.swing.JPanel pnBTBuscarConsulta;
    private javax.swing.JPanel pnBTNovaConsulta;
    private javax.swing.JPanel pnBuscarConsulta;
    private javax.swing.JPanel pnNovaConsulta;
    private javax.swing.JPanel pnPrincipal;
    private javax.swing.JTextField txCPF;
    private javax.swing.JTextField txCSC;
    private javax.swing.JTextField txCSC2;
    private javax.swing.JTextField txNome;
    private javax.swing.JTextField txNome2;
    private javax.swing.JTextField txNumeroConsulta;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the tabela
     */
    public TB_Paciente getTabela() {
        return tabela;
    }

    /**
     * @param tabela the tabela to set
     */
    public void setTabela(TB_Paciente tabela) {
        this.tabela = tabela;
    }
}
